/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 送货通知Entity
 * @author HOHD
 * @version 2020-12-19
 */
@Table(name="st_send_notice_bill", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="bill_no", attrName="billNo", label="单据号"),
		@Column(name="bill_date", attrName="billDate", label="单据日期"),
		@Column(name="sale_bill_no", attrName="saleBillNo", label="销售单号"),
		@Column(name="material_code", attrName="materialCode", label="物料编码"),
		@Column(name="material_name", attrName="materialName", label="物料名称", queryType=QueryType.LIKE),
		@Column(name="custom", attrName="custom", label="客户"),
		@Column(name="duty_man", attrName="dutyMan", label="业务员"),
		@Column(name="duty_man_code", attrName="dutyManCode", label="业务员编码"),
		@Column(name="address", attrName="address", label="收货地址"),
		@Column(name="consignee", attrName="consignee", label="收货人"),
		@Column(name="phone", attrName="phone", label="电话"),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
	}, orderBy="a.id DESC",joinTable = {
		@JoinTable(on = "customN.id=a.custom",entity = StCustomRecord.class,attrName = "customN",alias = "customN",type = Type.LEFT_JOIN)
}
)
public class StSendNoticeBill extends DataEntity<StSendNoticeBill> {
	
	private static final long serialVersionUID = 1L;
	private String billNo;		// 单据号
	private Date billDate;		// 单据日期
	private String saleBillNo;		// 销售单号
	private String materialCode;		// 物料编码
	private String materialName;		// 物料名称
	private String custom;		// 客户
	private StCustomRecord customN;		// 客户
	private String dutyMan;		// 业务员
	private String dutyManCode;		// 业务员编码
	private String address;		// 收货地址
	private String consignee;		// 收货人
	private String phone;		// 电话
	private List<StSendNoticeBillDetail> stSendNoticeBillDetailList = ListUtils.newArrayList();		// 子表列表
	
	public StSendNoticeBill() {
		this(null);
	}

	public StSendNoticeBill(String id){
		super(id);
	}
	
	@Length(min=0, max=20, message="单据号长度不能超过 20 个字符")
	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}

	public StCustomRecord getCustomN() {
		return customN;
	}

	public void setCustomN(StCustomRecord customN) {
		this.customN = customN;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBillDate() {
		return billDate;
	}

	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}
	
	@Length(min=0, max=20, message="销售单号长度不能超过 20 个字符")
	public String getSaleBillNo() {
		return saleBillNo;
	}

	public void setSaleBillNo(String saleBillNo) {
		this.saleBillNo = saleBillNo;
	}
	
	@Length(min=0, max=20, message="物料编码长度不能超过 20 个字符")
	public String getMaterialCode() {
		return materialCode;
	}

	public void setMaterialCode(String materialCode) {
		this.materialCode = materialCode;
	}
	
	@Length(min=0, max=36, message="物料名称长度不能超过 36 个字符")
	public String getMaterialName() {
		return materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}
	
	@Length(min=0, max=36, message="客户长度不能超过 36 个字符")
	public String getCustom() {
		return custom;
	}

	public void setCustom(String custom) {
		this.custom = custom;
	}
	
	@Length(min=0, max=5, message="业务员长度不能超过 5 个字符")
	public String getDutyMan() {
		return dutyMan;
	}

	public void setDutyMan(String dutyMan) {
		this.dutyMan = dutyMan;
	}
	
	@Length(min=0, max=20, message="业务员编码长度不能超过 20 个字符")
	public String getDutyManCode() {
		return dutyManCode;
	}

	public void setDutyManCode(String dutyManCode) {
		this.dutyManCode = dutyManCode;
	}
	
	@Length(min=0, max=40, message="收货地址长度不能超过 40 个字符")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@Length(min=0, max=5, message="收货人长度不能超过 5 个字符")
	public String getConsignee() {
		return consignee;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}
	
	@Length(min=0, max=20, message="电话长度不能超过 20 个字符")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public List<StSendNoticeBillDetail> getStSendNoticeBillDetailList() {
		return stSendNoticeBillDetailList;
	}

	public void setStSendNoticeBillDetailList(List<StSendNoticeBillDetail> stSendNoticeBillDetailList) {
		this.stSendNoticeBillDetailList = stSendNoticeBillDetailList;
	}
	
}